﻿@{
    Layout = null;
    ViewData["title"] = "订单详情";
    var OrderDe = ViewBag.OrderDe as List<BuyWithoutLoseMoney.Core.Models.OrderDetails>;
    var Product = ViewBag.Product as List<BuyWithoutLoseMoney.Core.Models.Product>;
    var Order = ViewBag.Order as List<BuyWithoutLoseMoney.Core.Models.Order>;
    var UserAddress =  ViewBag.UserAddress as List<BuyWithoutLoseMoney.Core.Models.UserAddress>;

    var User = ViewBag.User as List<BuyWithoutLoseMoney.Core.Models.User>;
    var id = ViewBag.Id;
}
@model IEnumerable<BuyWithoutLoseMoney.Core.Models.OrderDetails>;
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>订单详情</title>
    
    <link href="/layui/css/layui.css" rel="stylesheet" />
    </head>
    <body>
    <table class="layui-table" lay-even lay-skin="line">
        <colgroup>
            <col width="10">
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
            <tr>
                <th>ID</th>
                <th>收货人</th>
                <th>联系电话</th>
                <th>收货地址</th>
                <th>产品名字</th>
                <th>单价</th> 
                <th>数量</th>
                <th>总金额</th>
                @*<th>描述</th>*@
                <th>购买时间</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item1 in Order.Where(x=>x.Id==id))
            {
                <tr>
                    <td>@item1.Id</td>
                    <td>
                            @foreach(var item4 in UserAddress.Where(x => x.Id == int.Parse(item1.ReceivingAddress)))
                            {
                                @item4.Name
                            }
                    </td>
                    <td>
                            @foreach(var item4 in UserAddress.Where(x => x.Id == int.Parse(item1.ReceivingAddress)))
                            {
                                @item4.Phone
                            }
                        }
                    </td><td>
                            @foreach(var item4 in UserAddress.Where(x => x.Id == int.Parse(item1.ReceivingAddress)))
                            {
                               @item4.Province @item4.City @item4.DisTrict @item4.DetailedAddress
                            }
                    </td>
                    <td>
                        @foreach (var item3 in Product.Where(x=>x.Id==int.Parse(item1.Ext1)))
                        {
                            @item3.Title
                        }
                    </td>
                    <td>@item1.TotalMoney</td>
                    <td>1</td>
                    <td>@(1*item1.TotalMoney)</td>
                    @*<td>@item1.Describe</td>*@
                    <td>@item1.CreateTime.ToString()</td>
                </tr>
            }
        </tbody>
        <tr>
            <td></td>
        </tr>
    </table>
    <script src="/js/vue.js"></script>
    <script src="/layui/layui.js"></script>
    <script>
        layui.user('table',function(){
            var table=layui.table;
        });
    </script>
    </body>
</html>

   
